import { GameModeDetail } from "../gameManager";

//
export enum GAME_MODE {
  NORMAL = 0, //闯关模式
  CARD_COMPOSITION = 1,  //最新关卡模式
  SHENQIHANZI = 3, //神奇汉字模式
  WANGENG = 4, //玩梗消除模式
  LIANXIAN = 5, //连线达人模式
  FIGHTMDOE,
  ONE_CHAR,
  RED_BLOCK
}

//场景类别
export enum SCENE_MODE {
  NORMAL,
  //场景
  FIRE = 0,
  //预制体
  PREFAB,
}

//模式配置
const MODES: GameModeDetail[] = [
  {
    type: GAME_MODE.NORMAL,
    name: "normalMode",
    sceneName: "normalMode",
    sceneMode: SCENE_MODE.FIRE,
    explain: "射箭大师",
    lookVideCount: 0,
  },
  {
    type: GAME_MODE.CARD_COMPOSITION,
    name: "normalMode",
    sceneName: "normalMode",
    sceneMode: SCENE_MODE.FIRE,
    explain: "解压扑克",
    lookVideCount: 0,
  },
  {
    type: GAME_MODE.SHENQIHANZI,
    name: "normalMode",
    sceneName: "normalMode",
    sceneMode: SCENE_MODE.FIRE,
    explain: "神奇文字",
    lookVideCount: 0,
  },
  {
    type: GAME_MODE.WANGENG,
    name: "normalMode",
    sceneName: "normalMode",
    sceneMode: SCENE_MODE.FIRE,
    explain: "救救动物",
    lookVideCount: 0,
  },
  {
    type: GAME_MODE.LIANXIAN,
    name: "normalMode",
    sceneName: "normalMode",
    sceneMode: SCENE_MODE.FIRE,
    explain: "黄金矿工",
    lookVideCount: 0,
  },
  {
    type: GAME_MODE.FIGHTMDOE,
    name: "fightMode",
    sceneName: "fightMode",
    sceneMode: SCENE_MODE.FIRE,
    explain: "闯关模式",
    lookVideCount: 0,
  },
  {
    type: GAME_MODE.ONE_CHAR,
    name: "oneCharMode",
    sceneName: "oneCharMode",
    sceneMode: SCENE_MODE.FIRE,
    explain: "闯关模式",
    lookVideCount: 0,
  },
  {
    type: GAME_MODE.RED_BLOCK,
    name: "redBlock",
    sceneName: "redBlock",
    sceneMode: SCENE_MODE.FIRE,
    explain: "红木模式",
    lookVideCount: 0,
  }
];
//TODO 新模式看这里
type IModeMap = {
  [mode in GAME_MODE]: GameModeDetail;
};

let map: IModeMap = <IModeMap>{};
let mapInit = () => {
  for (let index = 0; index < MODES.length; index++) {
    const element = MODES[index];
    map[element.type] = element;
  }
};
mapInit();
export default function () {
  //
  return map;
}
